<!--{Atemplate tpl/header}-->

<!--{eval echo $this->Ahtml_js_aurl();}-->
<script>
function send_time(tm){
	var jbj = jQuery('.sms_send form input[name="sendtime"]');
	var date = Acan.time('Y-m-d H:i:s',Acan.time()+tm);
	jbj.val(date);
	return false;
}
function chk_type(id){
	if(!id) id = 3;
	jQuery('.sms_send form input[name="type"]').val([id]);
	if(id=='3'){
		jQuery('.sms_phone').show();
	}else{
		jQuery('.sms_phone').hide();
	}
}
function chk_note(){
	var nbj = jQuery('.sms_send form textarea[name="note"]');
	var note = nbj.val();
	jQuery('.sms_send #note_size').text(note.length);
	jQuery('.sms_send #note_sizes').text(65-note.length);
	return false;
}
function chk_form(){
	var nbj = jQuery('.sms_send form textarea[name="note"]');
	var note = nbj.val();
	if(note.length>65){
		alert('字数超过65字');
		nbj.focus();
	}else if(note.length<10){
		alert('内容太少');
		nbj.focus();
	}else{
		return true;
	}
	return false;
}
jQuery(document).ready(function(){
	chk_type({$post[type]});
});
</script>
<div class="sms_send">
<form action="" onsubmit="return chk_form();" method="post">
<table class="-table" style="width:600px;">
	<tr>
		<td>发送对象</td>
		<td>
			<span onclick="chk_type(1)"><input type="radio" name="type" value="1"/>外盘群发</span>
			<span onclick="chk_type(2)"><input type="radio" name="type" value="2"/>国内群发</span>
			<span onclick="chk_type(3)"><input type="radio" name="type" value="3" checked/>自输号码</span>
		</td>
	</tr>
	<tr class="sms_phone">
		<td>号码</td>
		<td><textarea name="phone" style="width:300px;height:100px;">$post[phone]</textarea></td>
	</tr>
	<tr>
		<td>内容</td>
		<td>
			<textarea name="note" style="width:300px;height:60px;" onkeyup="chk_note()">$post[note]</textarea>
			<br>已输字数:<span id="note_size">0</span>字<br>可输字数:<span id="note_sizes">65</span>字
		</td>
	</tr>
	<tr>
		<td>发送时间</td>
		<td>
			<input type="text" name="sendtime" value="$post[sendtime]"/>
			<span onclick="send_time(0)">现在</span>
			<span onclick="send_time(60)">1分钟后</span>
			<span onclick="send_time(600)">10分钟后</span>
			<span onclick="send_time(1800)">30分钟后</span>
			<span onclick="send_time(3600)">1小时后</span>
		</td>
	</tr>
	<tr>
		<td></td>
		<td><input type="submit"><input type="reset"></td>
	</tr>
</table>


</form>

</div>

<!--{Atemplate tpl/nofooter}-->